Page({
  data: {
    playing: [
      {
        title: 'A',
        desc: 'AA',
        score: 7.5,
        date: 2021,
        state: '中国',
        img: 'https://gw.alipayobjects.com/zos/skylark-tools/public/files/68cab7c01342526257936a6bf8db448f.png',
        director: '吴京',
        actor: '吴京, 吴京, 吴京'
      }
    ]
  },
  onLoad(query) {
    // 页面加载
    console.info(`加载 onLoad with query: ${JSON.stringify(query)}`);

    function jQuery1102008625659700403299_1634197349187(data) {
      console.log('data', data)
    }

    my.request({
      url: 'https://sp1.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php?resource_id=28286&from_mid=1&&format=json&ie=utf-8&oe=utf-8&query=%E7%94%B5%E5%BD%B1&sort_key=17&sort_type=1&stat0=&stat1=&stat2=&stat3=&pn=0&rn=8&cb=jQuery1102008625659700403299_1634197349187&_=1634197349220',
      method: 'GET',
      dataType: 'string',
      success: (resp) => {
        let res = resp.data.replace('jQuery1102008625659700403299_1634197349187(', '')
        res = JSON.parse(res.substring(0, res.length -1))

        console.log(this.data)

        this.setData({
          playing: res.data[0].result.map(item => ({
            title: item.name,
            score: item.additional,
            img: item.kg_pic_url,
            state: '中国',
            date: new Date().getFullYear(),
            director: '--',
            actor: '--'
          }))
        })
        console.log(res.data[0].result)
      },
      fail: (err) => {
        console.log('error', err);
      },
    });
  },
})